home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Testing & Debugging / Virtual User tools / SPEC S&L v.1.0.1 / Libraries / OutPut.Lib < prev    next >
Encoding:
Text File  |  1993-12-17  |  2.9 KB  |  88 lines  |  [TEXT/MPS ]

  1. #
  2. # ****************************************************************************
  3. #
  4. #    File Name:        OutPut.Lib
  5. #
  6. #    Contains:    Tasks used for output
  7. #
  8. #    Written by:    Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
  9. #
  10. #    Copyright:    © 1993 by Apple Computer, Inc., all rights reserved.
  11. #
  12. # ****************************************************************************
  13. #            C h a n g e        H i s t o r y (most recent first):
  14. # ****************************************************************************
  15. #
  16. #        Vers      Date        Author        Description
  17. #        ----    --------    ------    ---------------------------------------------
  18. #     <1.0.5>     12/2/93    KTA        LogStr()- added gLogStrHook to do anything custom after logging.
  19. #     <1.0.3>      6/8/93    NAGA        unmark tasks that are not published
  20. #     <1.0.2>     5/21/93    NAGA        Adding header and porting old files to follow new standards
  21. #
  22. # ****************************************************************************
  23. #
  24.  
  25. #########################################################################
  26. #                    LogStr(str, errorCheck,doTargetCheck)
  27. #========================================================================
  28. # Author:        KTA
  29. # Description:    Match the target and print it with whatever is passed
  30. #                to it in the 'str' parameter.  Set the appropriate 
  31. #                LogPriority based on the context of the string.
  32. # Parameters:    str - string to be printed
  33. #                LogPriority -    The priority of the string to be printed
  34. #                0 - No logging
  35. #                1 - Errors
  36. #                2 - Comments and Notes
  37. #                3 - Summary information
  38. #                4 - More detailed
  39. #                5 - Detailed description
  40. # Returns:        Nothing
  41. # Examples:        LogStr("It worked");
  42. #                LogStr("It worked",3);
  43. # Assumptions:        None 
  44. #========================================================================
  45. # History:
  46. # KTA    12/01/93     Added gLogStrHook
  47. #########################################################################
  48. TASK LogStr(str,LogPriority := 5) 
  49. begin
  50.     global gTargetCheck, gAppTitle, gLogLevel,gLogStrCount, gDisableAllLogging;
  51.     theStr := '';
  52.     if (gTargetCheck)
  53.         theStr := TargetInfo();
  54.  
  55.     if (LogPriority <= gLogLevel) and not (gDisableAllLogging)
  56.     begin
  57.         gLogStrCount := gLogStrCount + 1;
  58.         println gLogStrCount," - ",str," {theStr} ";
  59.     end;
  60.     if(global gLogStrHook)
  61.         Call(gLogStrHook);
  62.  
  63. end; # LogStr()
  64.  
  65. #########################################################################
  66. #                            TargetInfo(theList)
  67. #========================================================================
  68. # Author:        NJV/KTA
  69. # Description:    Match application running on Target
  70. # Parameters:    nada - 
  71. # Returns:        Returns application running on Target
  72. # Examples:        
  73. #========================================================================
  74. # History:
  75. #
  76. #########################################################################
  77. task TargetInfo() 
  78. begin
  79.     theDescInfo := match [target t:?TargetTitle a:?App]!;
  80.     theAppTitle :=App[1].t;
  81.     
  82.     if not (theDescInfo)
  83.         return('');    
  84.             
  85.     str := "(Target - Application:∂'{theAppTitle}∂')";
  86.             return(str);
  87. end; # TargetInfo()
  88.